package com.starry.core.ext

import android.widget.Toast
import com.starry.core.App

/**
 * Package:com.starry.dotpen_patients.utils
 * Author:starr
 * Time:2024/3/18 0:03
 * Description: toast工具类
 */

fun toast(msg: String) {
    ZKToastUtil.showShort(msg)
}

object ZKToastUtil {

    private const val LENGTH_SHORT = Toast.LENGTH_SHORT
    fun showShort(msg: String?) {
        show(msg ?: "")
    }

    /**
     * @param msg String
     * @param duration Int
     */
    private fun show(msg: String, duration: Int = LENGTH_SHORT) {
        Toast.makeText(App.mContext, msg, duration).show()
    }


}